package com.ruoyi.system.pojo.util;

import java.util.Objects;

public class Pair {
        private final Long first;
        private final Long second;

        public Pair(Long a, Long b) {
            if (a > b) {
                this.first = b;
                this.second = a;
            } else {
                this.first = a;
                this.second = b;
            }
        }
        // 添加 Getter 方法
        public Long getFirst() {
            return first;
        }

        public Long getSecond() {
            return second;
        }
        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair pair = (Pair) o;
            return first.equals(pair.first) && second.equals(pair.second);
        }

        @Override
        public int hashCode() {
            return Objects.hash(first, second);
        }
}
